package com.dabaozhan.modules.wx_app.base;

import java.io.Serializable;

import com.dabaozhan.modules.wx_app.enums.ResponseCodeEnum;


public class ResponseDto<T> implements Serializable {

	private static final long serialVersionUID = 1L;

	/**
     * 返回状态码
     */
    private int code;

    /**
     * 返回状态码信息
     */
    private String message;
    
    /**
     * 分页总数
     */
    private Long total;
    
    /**
     * 第几页
     */
    private Integer page;

    /**
     * 返回具体数据
     */
    private T result;
    
    public void setResponseCodeEnum(ResponseCodeEnum response) {
        if (response != null) {
        	setCode(response.getCode());
        	setMessage(response.getDescription());
        }
    }

	public int getCode() {
		return code;
	}
	public void setCode(int code) {
		this.code = code;
	}
	public String getMessage() {
		return message;
	}
	public void setMessage(String message) {
		this.message = message;
	}
	public T getResult() {
		return result;
	}
	public void setResult(T result) {
		this.result = result;
	}

	public Long getTotal() {
		return total;
	}

	public void setTotal(Long total) {
		this.total = total;
	}

	public Integer getPage() {
		return page;
	}

	public void setPage(Integer page) {
		this.page = page;
	}
}

